<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title></title>
  <link rel="icon" type="image/x-icon" href="">
  <script src="http://webapi.amap.com/maps?v=1.4.6&key=d386d3cded6f3a3605ef9404d4fcef3d&plugin=AMap.MouseTool,AMap.PolyEditor,AMap.RectangleEditor,AMap.Geocoder"></script>
  <script>
  // 不同域名配置的基本信息
    var httpType = [{
      url: 'www.dashenmao.com',
      path: 'ws://www.jiaowawang.cn:9999',
      isChina: true,
      mark: '￥',
      unit: '元',
      length: 'km',
      lengthUnit: '公里',
      mLength: 'm',
      mLengthUnit: '米',
      weight: 'kg',
      weightUnit: '千克',
      kmUnit: 1,
      mUnit: 1,
      kgUnit: 1
    }, {
      url: 'waimai.jiaowawang.cn',
      path: 'ws://www.jiaowawang.cn:9999',
      isChina: true,
      mark: '￥',
      unit: '元',
      length: 'km',
      lengthUnit: '公里',
      mLength: 'm',
      mLengthUnit: '米',
      weight: 'kg',
      weightUnit: '千克',
      kmUnit: 1,
      mUnit: 1,
      kgUnit: 1
    },{
      url: 'www.ptgwm.com',
      path: 'ws://www.jiaowawang.cn:9999',
      isChina: true,
      mark: '￥',
      unit: '元',
      length: 'km',
      lengthUnit: '公里',
      mLength: 'm',
      mLengthUnit: '米',
      weight: 'kg',
      weightUnit: '千克',
      kmUnit: 1,
      mUnit: 1,
      kgUnit: 1
    }, {
      url: 'dashenmao.zzdelivery.com',
      path: 'ws://dashenmao.zzdelivery.com:8083',
      isChina: false,
      mark: '￡',
      unit: '英镑',
      length: 'mi',
      lengthUnit: '英里',
      mLength: 'm',
      mLengthUnit: '码',
      weight: 'lb',
      weightUnit: '磅',
      kmUnit: 1.609344,
      mUnit: 0.9144,
      kgUnit: 0.4535924
    }, {
      url: 'xgzp.dashenmao.com',
      path: 'ws://www.jiaowawang.cn:8083',
      isChina: false,
      mark: '￥',
      unit: '元',
      length: 'km',
      lengthUnit: '公里',
      mLength: 'm',
      mLengthUnit: '米',
      weight: 'kg',
      weightUnit: '千克',
      kmUnit: 1,
      mUnit: 1,
      kgUnit: 1
    }, {
      url: 'localhost',// 本地环境
      path: 'ws://www.jiaowawang.cn:9999',
      isChina: false,
      mark: '￡',
      unit: '英镑',
      length: 'mi',
      lengthUnit: '英里',
      mLength: 'm',
      mLengthUnit: '码',
      weight: 'lb',
      weightUnit: '磅',
      kmUnit: 1.609344,
      mUnit: 0.9144,
      kgUnit: 0.4535924
    }]
    var isChina = true // 定义国内国外环境
    var comConfig = {}
    var bUrl = window.location.href
    for (var i = 0; i < httpType.length; i++) {
      if (bUrl.indexOf(httpType[i].url) > -1) {
        isChina = httpType[i].isChina
        comConfig = httpType[i]
        break
      }
    }

    if (bUrl.indexOf('abroad=') > -1) { // 国内调试国外模式
      isChina = false
    }
    // 加载地图
    var url = 'https://maps.googleapis.com/maps/api/js?key=AIzaSyB8Levvv6YHqhVrsVKFd4y3y0NXYVyKZ1g&libraries=places,drawing&callback=initMap'
    var jsapi = document.createElement('script')
    if (!isChina) {
      jsapi.src = url
      jsapi.setAttribute('async', true)
      jsapi.setAttribute('defer', true)
      document.head.appendChild(jsapi)
      function initMap() {
        var richMarker = document.createElement('script')
        richMarker.src = 'assets/js/richMarker.js'
        document.head.appendChild(richMarker)
      }
    }
    // 动态判断修改ico
    var link = document.querySelector("link[rel*='icon']");
    link.type = 'image/x-icon';
    link.rel = 'shortcut icon';
    const icons = ['www.ptgwm.com', 'waimai.jiaowawang.cn']
    const index = icons.findIndex(url => bUrl.indexOf(url) > -1)
    if (index == 0) {
      link.href = 'assets/ico/pingtouge.ico'
      document.title = '平头哥后台管理' 
    } else if( index == 1) {
      link.href = 'assets/ico/jiaowa.ico'
      document.title = '叫哇外卖后台管理' 
    } else {
      link.href = 'assets/ico/favicon.ico'
      document.title = '大神猫后台管理'
    }
    
  </script>
  <script src="//webapi.amap.com/ui/1.0/main.js"></script>
  <script src="https://at.alicdn.com/t/font_623942_ohgv5m8e3up.js"></script>
</head>
<body>
  <div id="app"></div>
</body>
</html>

